package com.hay.item.mapper;

import com.hay.item.pojo.Category;
import org.apache.ibatis.annotations.Select;
import tk.mybatis.mapper.additional.idlist.SelectByIdListMapper;
import tk.mybatis.mapper.common.Mapper;

import java.util.List;

public interface CategoryMapper extends Mapper<Category>, SelectByIdListMapper<Category, Long> {

    @Select("select c.* from tb_category c JOIN tb_category_brand b on c.id = b.category_id where b.brand_id = #{bid}")
    List<Category> queryByBrandId(Long bid);
}
